// 实时监测数据的请求
import request from '../../utils/request'

// 水压数据请求
export let dataGet = (arr: Array<number>) => {
    let query = JSON.stringify({ pressure: { $gte: arr[0], $lt: arr[1] } })
    if (arr[0] == 100) {
        query = JSON.stringify({ attention: 2 })
    }
    return request.get(`classes/RealTimeData?where=${query}`)
}
// 水流请求
export let flowGet = (arr: Array<number>) => {
    let query = JSON.stringify({ instantFlow: { $gte: arr[0], $lt: arr[1] } })
    if (arr[0] == 100) {
        query = JSON.stringify({ attention: 2 })
    }
    return request.get(`classes/RealTimeData?where=${query}`)
}
// 水质请求
export let qualityGet = (arr: Array<number>) => {
    let query = JSON.stringify({ cloudyDegree: { $gte: arr[0], $lt: arr[1] } })
    if (arr[0] == 100) {
        query = JSON.stringify({ attention: 2 })
    }
    return request.get(`classes/RealTimeData?where=${query}`)
} 